/*
 * @Author: yu_十三 13wl@sohu.com
 * @Date: 2024-11-27 14:34:58
 * @LastEditors: yu_十三 13wl@sohu.com
 * @LastEditTime: 2024-11-27 15:58:03
 * @FilePath: \web_ts\src\main.ts
 * @Description: 全局入口
 *
 */

import "@/store/install";
import { useDataStore } from "@/store/data";

// 公共样式
import "./styles/reset.scss";
import "./styles/layout.scss";
import "./styles/main.scss";
import "../static/css/theme/light.css";

// header nav
import "@/modules/header";
import "@/modules/nav";

// side
import "@/modules/side";

// log_list
import "@/pages/log_list";

// echo_log
import "@/pages/echo_log";

// page
import "@/pages/page";

// footer

import "@/modules/footer";

//监听scroll事件，记录滚动条位置
const dataStore = useDataStore();
function updateScrollY() {
	dataStore.setScrollY(document.documentElement.scrollTop || document.body.scrollTop);
}
updateScrollY();
window.addEventListener("scroll", updateScrollY);

//监听resize事件，记录窗口大小
function updateWindowSize() {
	dataStore.setWindowWidth(window.innerWidth);
	dataStore.setWindowHeight(window.innerHeight);
}
updateWindowSize();
window.addEventListener("resize", updateWindowSize);

//ascii
if (process.env.NODE_ENV !== "development") {
}
